package com.yxq.mdt.app.modules.market.bean;

import com.chad.library.adapter.base.entity.MultiItemEntity;

/**
 * @author L
 * @time 2019-10-21
 * @describe 商城自定义模块数据
 */
public class MallRecommendBean extends MallListBean implements MultiItemEntity {

    private MallResponseBean.BlockListBean blockListBean;

    public void setBlockListBean(MallResponseBean.BlockListBean blockListBean) {
        this.blockListBean = blockListBean;
    }

    public MallResponseBean.BlockListBean getBlockListBean() {
        return blockListBean;
    }

    @Override
    public int getItemType() {
        int type = MALL_ITEM_TYPE_RECOMMEND_STYLE_0_1;
        switch (blockListBean.getStyle()) {
            case 0:
                switch (blockListBean.getData().getPic_list().size()) {
                    case 1:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_0_1;
                        break;
                    case 2:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_0_2;
                        break;
                    case 3:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_0_3;
                        break;
                    case 4:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_0_4;
                        break;
                }
                break;
            case 1:
                switch (blockListBean.getData().getPic_list().size()) {
                    case 2:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_1_2;
                        break;
                    case 3:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_1_3;
                        break;
                    case 4:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_1_4;
                        break;
                }
                break;
            case 2:
                switch (blockListBean.getData().getPic_list().size()) {
                    case 4:
                        type = MALL_ITEM_TYPE_RECOMMEND_STYLE_2_4;
                        break;
                }
                break;
        }
        return type;
    }

}
